import { useEffect, URLSearchParams } from "react";

const useDidMount = (fn) => {
    useEffect(() => {
        fn()
    }, [])
}
const usewillUnmount = (fn) => {
    useEffect(() => {
        return fn                     
    }, [])                           
}
const useDidUpdate = (fn) => {
    useEffect(() => {
        fn()
    })
}

export const useGetQuerry = (url) => {
    const querry = {};
    const search = url.split('?')[1].split("#")[0];
    search.split("&").forEach((item) => {
        querry[item.split("=")[0]] = item.split("=")[1]
    })
    return querry;
}

const jieliu =()=>{
    
}